package com.iamteer.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.iamteer.dao.IEmployeeDao;
import com.iamteer.entity.Employee;
import com.iamteer.utils.JdbcUtil;

public class EmployeeDao implements IEmployeeDao{

	@Override
	public List<Employee> getAll() {
		try {
			String sql = "select * from employee";
			return JdbcUtil.getQueryRunner().query(sql, new BeanListHandler<Employee>(Employee.class));
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
	}
	
}
